//
//  ViewController.m
//  ZKChain
//
//  Created by 洪绵卫 on 2022/1/11.
//

#import "ViewController.h"
#import "UIView+ZKChain.h"
#import "UILabel+ZKChain.h"
#import "UIButton+ZKChain.h"
#import "UIImageView+ZKChain.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIView * v = UIView.zk_allocInit()
                .zk_backgroundColor([UIColor redColor])
                .zk_frame(CGRectMake(50, 50, 100, 100))
                .zk_userInteractionEnabled(YES)
                .zk_tag(12)
                .zk_addToSuperView(self.view);

    NSLog(@" v = %@",v);

    UILabel * lab = UILabel.zk_allocInitWithFrame(CGRectMake(100, 200, 100, 100))
                           .zk_backgroundColor([UIColor yellowColor])
                           .zk_addToSuperView(self.view)
                           .zk_textAlignment(NSTextAlignmentCenter);
    NSLog(@" lab = %@",lab);

    UIButton * btn = UIButton.zk_allocInitWithButtonType(UIButtonTypeCustom)
                             .zk_addToSuperView(self.view)
                             .zk_frame(CGRectMake(200, 350, 100, 100))
                             .zk_setTitleForState(@"ddd",UIControlStateNormal)
                             .zk_highlighted(true)
                             .zk_font([UIFont systemFontOfSize:18.0])
                             .zk_setTitleColorForState(UIColor.purpleColor,UIControlStateHighlighted)
                             .zk_enabled(false)
                             .zk_backgroundColor(UIColor.orangeColor)
                             .zk_setBackgroundImageForState([UIImage imageNamed:@"salary_top1.png"],UIControlStateHighlighted)
                             .zk_setImageForState([UIImage imageNamed:@"salary_top1.png"],UIControlStateHighlighted);

    NSLog(@" btn = %@",btn);
    
    
    UIImageView * img = UIImageView.zk_allocInitWithImage([UIImage imageNamed:@"salary_top1.png"])
                                   .zk_frame(CGRectMake(50, 350, 100, 100))
                                   .zk_addToSuperView(self.view);
    NSLog(@" img = %@",img);
}


@end

